package com.group3.group3.baobiao.priceinfo.control;


import com.group3.group3.baobiao.priceinfo.entity.PriceinfoSearchEnity;
import com.group3.group3.baobiao.priceinfo.service.PriceinfoService;
import com.group3.group3.mybatis.entity.InternationalPriceEntity;
import com.group3.group3.mybatis.flexigrid.PadingRstType;
import com.group3.group3.mybatis.flexigrid.PagingBean;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author Hhw-byte
 * @create 2022-05-16 11:08
 */
@Controller
@RequestMapping("/priceinfo")
public class PriceinfoController {
    private Logger logger =  LogManager.getLogger(this.getClass().getName());
    @Resource
    private PriceinfoService priceinfoService;
    @Secured("ROLE_gqgy_data_price")

    @RequestMapping("/page")
    public String userPage(){
        return "priceinfo/pricepage";
    }

    @RequestMapping("/getPriceInfoListByPage")
    @ResponseBody
    public PadingRstType<InternationalPriceEntity> getPriceinfoListByPage(PriceinfoSearchEnity search, PagingBean paging){
        logger.info(search);
        PadingRstType<InternationalPriceEntity> internationalPriceEntityPadingRstType = priceinfoService.getPriceinfoListByPage(search, paging);
        return internationalPriceEntityPadingRstType;
    }

}
